from ..miniCurl import Curl
from ..t  import T
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#__author__ = '2chuizi'


class P(T):
    def __init__(self):
        T.__init__(self)
    def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
        arg='http://'+ip+':'+port+'/'
        curl=Curl()
        result = {}
        result['result']=False

        components=['com_5starhotels','com_aardvertiser','com_ab_gallery','com_abbrev','com_abc','com_about','com_acajoom','com_acctexp','com_aclassf','com_acmisc','com_acooldebate','com_acprojects','com_acstartseite','com_acteammember','com_actions','com_activities','com_actualite','com_adagency','com_addressbook','com_adds','com_adsmanager','com_advertising','com_agency','com_agenda','com_agora','com_agoragroup','com_airmonoblock','com_akobook','com_alameda','com_alberghi','com_album','com_alert','com_alfresco','com_alfurqan15x','com_allcinevid','com_allhotels','com_allvideos','com_alphacontent','com_alphauserpoints','com_altas','com_amblog','com_ambrasubs','com_aml_2','com_amocourse','com_annonces','com_appointinator','com_appointment','com_arcadegames','com_archeryscores','com_artforms','com_articleman','com_articlemanager','com_articles','com_artist','com_artportal','com_as','com_asortyment','com_autartimonial','com_autartitarot','com_avosbillets','com_awd_song','com_awdwall','com_awiki','com_b2portfolio','com_banners','com_bca-rss-syndicator','com_beamospetition','com_bearleague','com_beeheard','com_beeheardlite','com_bfquiztrial','com_bfsurvey','com_bfsurvey_pro','com_biblestudy','com_biblioteca','com_bidding','com_billyportfolio','com_biographies','com_blabla','com_blablubb','com_blog','com_blogfactory','com_book','com_bookflip','com_bookjoomlas','com_books','com_brightweblinks','com_bsadv','com_business','com_buslicense','com_ca','com_calendario','com_camelcitydb2','com_camp','com_candle','com_canteen','com_carman','com_cartweberp','com_casino','com_casino_blackjack','com_casino_videopoker','com_casinobase','com_catalogproduction','com_categories','com_category','com_cbe','com_cbresumebuilder','com_ccinvoices','com_ccnewsletter','com_cgtestimonial','com_chronoconnectivity','com_chronocontact','com_cinema','com_ckforms','com_clanlist','com_clantools','com_clasifier','com_cloner','com_cmimarketplace','com_collector','com_color','com_comments','com_community','com_communitypolls','com_comp','com_comprofiler','com_connect','com_contact','com_contactinfo','com_content','com_contentbloglist','com_countries','com_crowdsource','com_custompages','com_cvmaker','com_cx','com_d-greinar','com_d3000','com_dailymeals','com_dailymessage','com_dashboard','com_datafeeds','com_dateconverter','com_datsogallery','com_dbquery','com_dcnews','com_dcs_flashgames','com_delicious','com_departments','com_detail','com_dhforum','com_diary','com_digifolio','com_digistore','com_dioneformwizard','com_directory','com_discussions','com_djartgallery','com_djcatalog','com_djclassifieds','com_djiceshoutbox','com_dm_orders','com_dms','com_doc','com_docman','com_doqment','com_drawroot','com_dshop','com_dtregister','com_dwgraphs','com_easygb','com_econtent','com_education_classes','com_education_classess','com_elite_experts','com_ensenanzas','com_eportfolio','com_equipment','com_equotes','com_estateagent','com_event','com_eventcal','com_eventing','com_eventlist','com_expose','com_expshop','com_extplorer','com_ezautos','com_ezine','com_ezstore','com_fabrik','com_facebook','com_facileforms','com_family','com_fantasytournament','com_fastball','com_fbb','com_filebase','com_filiale','com_finder','com_fireboard','com_flash','com_flashgames','com_flashmagazinedeluxe','com_flexicontent','com_flippingbook','com_flipwall','com_foobla_suggestions','com_football','com_formtool','com_frontpage','com_fss','com_g2bridge','com_gadgetfactory','com_galeria','com_galleryxml','com_gambling','com_gameq','com_gamesbox','com_gameserver','com_ganalytics','com_gbufacebook','com_gcalendar','com_gds','com_genealogy','com_giftexchange','com_gigcal','com_gigfe','com_gmaps','com_golfcourseguide','com_google','com_graphics','com_grid','com_groups','com_gsticketsystem','com_guide','com_gurujibook','com_hbssearch','com_hdvideoshare','com_hello','com_hello_world','com_hezacontent','com_hmcommunity','com_horoscope','com_horses','com_hotbrackets','com_hsconfig','com_huruhelpdesk','com_hwdvideoshare','com_icagenda','com_ice','com_icrmbasic','com_icrmbasicdemo','com_idoblog','com_if_nexus','com_if_surfalert','com_ignitegallery','com_iigcatalog','com_ijoomla_archive','com_ijoomla_rss','com_imagebrowser','com_img','com_include','com_inter','com_iomezun','com_iproperty','com_is','com_itarmory','com_items','com_j-projects','com_jabode','com_jacomment','com_jajobboard','com_janews','com_jashowcase','com_javoice','com_jb2','com_jbook','com_jbpublishdownfp','com_jbudgetsmagic','com_jce','com_jcollection','com_jcommunity','com_jdownloads','com_jdrugstopics','com_jeajaxeventcalendar','com_jeauto','com_jedirectory','com_jeemasms','com_jefaqpro','com_jeformcr','com_jeguestbook','com_jejob','com_jepoll','com_jequizmanagement','com_jequoteform','com_jesubmit','com_jfeedback','com_jfuploader','com_jfusion','com_jgen','com_jgrid','com_jimtawl','com_jinc','com_jinventory','com_jlord_rss','com_jmarket','com_jmovies','com_jmsfileseller','com_jnewspaper','com_joaktree','com_job','com_jobads','com_jobline','com_jobprofile','com_joltcard','com_jombib','com_jombib --','com_jomestate','com_joobb','com_jooget','com_joomclip','com_joomdle','com_joomgalaxy','com_joomgallery','com_joomlaboard','com_joomlaconnect_be','com_joomladate','com_joomlaflickr','com_joomlapicasa2','com_joomlaupdater','com_joomlavvz','com_joomlaxplorer','com_joomloads','com_joomloc','com_joomlub','com_joommail','com_joomnik','com_joomportfolio','com_joomradio','com_joomtouch','com_joomtracker','com_jooproperty','com_joovideo','com_jotloader','com_jp_jobs','com_jpad','com_jphone','com_jphoto','com_jpodium','com_jprojectmanager','com_jradio','com_jresearch','com_jreservation','com_jscalendar','com_jshop','com_jsjobs','com_jstore','com_jsubscription','com_jsupport','com_jtickets','com_jtips','com_jtm','com_jukebox','com_juliaportfolio','com_jumi','com_juser','com_jvehicles','com_jvideo','com_jvideodirect','com_jwhmcs','com_k2','com_kbase','com_kif_nexus','com_king','com_kk','com_kkcontent','com_konsultasi','com_ksadvertiser','com_kunena','com_lead','com_leader','com_letterman','com_lexikon','com_libros','com_linkr','com_listbingo','com_listing','com_liveticker','com_liveticker ','com_lms','com_loginbox','com_lovefactory','com_lowcosthotels','com_lyftenbloggie','com_mad4joomla','com_magazine','com_maianmedia','com_maianmusic','com_mailto','com_manager','com_market','com_marketplace','com_markt','com_matamko','com_mcquiz','com_mdigg','com_mediaalert','com_mediamall','com_mediaslide','com_mediqna','com_memory','com_menu','com_menus','com_messages','com_misterestate','com_mmsblog','com_model','com_modules','com_mosres','com_most','com_movm','com_mscomment','com_mtfireeagle','com_multimap','com_multiroot','com_musicgallery','com_mv_restaurantmenumanager','com_myalbum','com_myblog','com_mycar','com_mycontent','com_mydyngallery','com_myfiles','com_mygallery','com_mygallery ','com_myhome','com_mysms','com_n-forms','com_na_content','com_na_newsdescription','com_neogallery','com_neorecruit','com_neoreferences','com_netinvoice','com_network','com_news','com_news_portal','com_newsfeeds','com_newsflash','com_nfnaddressbook','com_niceajaxpoll','com_nicetalk','com_ninjacentral','com_ninjamonials','com_nkc','com_noticeboard','com_noticia','com_noticias','com_obsuggest','com_omnirealestate','com_omphotogallery','com_ongallery','com_onlineexam','com_oprykningspoint_mc','com_ops','com_org','com_orgchart','com_otzivi','com_ownbiblio','com_oziogallery','com_packages','com_pandafminigames','com_party','com_paxgallery','com_paxxgallery','com_pbbooking','com_pc','com_pcchess','com_pccookbook','com_people','com_perchacategoriestree','com_perchadownloadsattach','com_perchafieldsattach','com_perchagallery','com_perchaimageattach','com_personal','com_philaform','com_phocadocumentation','com_phocagallery','com_photobattle','com_photoblog','com_photomapgallery','com_php','com_picasa2gallery','com_picsell','com_pinboard','com_plugins','com_pms','com_poll','com_ponygallery','com_portafolio','com_portfol','com_powermail','com_prayercenter','com_press','com_pressrelease','com_preventive','com_prime','com_pro_desk','com_prod','com_productbook','com_products','com_productshowcase','com_profile','com_projectfork','com_properties','com_propertylab','com_puarcade','com_publication','com_qcontacts','com_qcontacts?=catid=0','com_qpersonel','com_question','com_quickfaq','com_quicknews','com_quiz','com_quran','com_races','com_races ','com_radio','com_ranking','com_rapidrecipe','com_rd_download','com_rdautos','com_realtyna','com_recerca','com_recipe','com_recly','com_record','com_redshop','com_redtwitter','com_referenzen','com_rekry','com_remository','com_reservations','com_resman','com_restaurante','com_restaurantguide','com_rokdownloads','com_rokmodule','com_route','com_rpx','com_rsappt_pro2','com_rsfiles','com_rsgallery','com_rsgallery2','com_rwcards','com_s5clanroster','com_salesrep','com_sar_news','com_sbsfile','com_scheduling','com_school','com_schools','com_science','com_search','com_searchlog','com_sebercart','com_sectionex','com_sections','com_seek','com_sef','com_seminar','com_serie','com_sermon','com_sermonspeaker','com_seyret','com_sg','com_shoutbox','com_siirler','com_simple_review','com_simpledownload','com_simplefaq','com_simpleshop','com_smartsite','com_smestorage','com_smslist','com_socialads','com_software','com_solution','com_soundset','com_spa','com_spec','com_spidercalendar','com_spidercatalog','com_spielothek','com_sponsorwall','com_sportfusion','com_spsnewsletter','com_start','com_staticxt','com_surveymanager','com_svmap','com_sweetykeeper','com_tags','com_tariff','com_teacher','com_team','com_tech_article','com_techfolio','com_television','com_thyme','com_ticketbook','com_tickets','com_tienda','com_timereturns','com_timetrack','com_tophotelmodule','com_topmenu','com_tour','com_tpdugg','com_tpjobs','com_trabalhe_conosco','com_trading','com_trash','com_travelbook','com_ttvideo','com_tupinambis','com_tweetla','com_ultimateportfolio','com_units','com_user','com_users','com_userstatus','com_versioning','com_videos','com_vikrealestate','com_virtuemart','com_vjdeo','com_volunteer','com_vr','com_vxdate','com_wallpapers','com_waticketsystem','com_webeecomment','com_weberpcustomer','com_weblinks','com_webtv','com_webtvcom_5starhotels','com_wgpicasa','com_wines','com_wisroyq','com_wmi','com_wmtpic','com_worldrates','com_wrapper','com_xevidmegahd','com_xewebtv','com_xfaq','com_xobbix','com_yanc','com_yanc ','com_ybggal','com_yellowpages','com_yelp','com_yjcontactus','com_ynews','com_youtube','com_youtubegallery','com_yvcomment','com_zcalendar','com_zimbcomment','com_zimbcore','com_zina','com_zoomportfolio']
        code_err, _, body_err, _, _, = curl.curl(arg + '/index.php?option=test2chuiziplugins')
        for plugin in components:
            scanurl = '%s/index.php?option=%s' % (arg, plugin)
            code, _, body, _, _, = curl.curl(scanurl)
            if code == 200 and body != body_err:
                output('%s :%s' % (plugin, arg),result,'note')
    

        del curl
        return result


def output(url,result,label):
    info = url + '  joomla  Vul '
    result['result']=True
    result['VerifyInfo'] = {}
    result['VerifyInfo']['type']='joomla Vul'
    result['VerifyInfo']['URL'] =url
    result['VerifyInfo']['payload']='/root/github/poccreate/thirdparty/joomla/joomla_5678b6311dbde4b94c58a3bf8409283b.py'
    result['VerifyInfo']['level']=label
    result['VerifyInfo']['result'] =info

if __name__== '__main__':
    print P().verify(ip='http://yunlai.cn:803/sfdsfds/',port='80')

#/root/github/poccreate/thirdparty/joomla/joomla_5678b6311dbde4b94c58a3bf8409283b.py
#/root/github/poccreate/codesrc/exp-255.py